<html>
<head>
    <title>透析助手</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.5.6/css/sm.min.css">
    <link rel="stylesheet" href="__PUBLIC__/css/style.css">
    <link rel="stylesheet" href="__PUBLIC__/css/5s.css">
    <link rel="stylesheet" href="__PUBLIC__/css/6m.css">
    <link rel="stylesheet" href="__PUBLIC__/css/iconfont.css">
</head>
<body>
	<div class="head head-another">
		<div class="HeadContent">
			<a href="<{:U('Index/index')}>" class="backIndex"><i class="iconfont">&#xe605;</i></a>
			<a href="javascript:;" class="HeadTitle">营养师列表</a>
		</div>
	</div>
	<div class="RecordInformation-public Nopadding PersonalList">
		<div class="DoctorType">
			<a href="<{:U('lists')}>">医生</a><a class="active" href="<{:U('nlists')}>">营养师</a>
		</div>
		<ul>
            <empty name="list">
                <li style="padding-top:15px;">暂 无 数 据</li>
            <else />
            <foreach name="list" item="vo">
            <li>
                <a href="javascript:;">
                <div class="LeftImg" onclick="location.href='<{:U('indexn',array('id'=>$vo['id']))}>'">
                    <if condition="$vo['pic'] eq ''">
                        <img src="__PUBLIC__/images/PersonalHeadImg.png">
                    <else />
                        <img src="<{$vo.pic}>">
                    </if>
                </div>
                <div class="MiddleContent" onclick="location.href='<{:U('indexn',array('id'=>$vo['id']))}>'">
                    <div class="MiddleHead">
                        <{$vo.name|default='营养师'}>  <{:$vo['sex']=='2'?'女':'男'}>
                    </div>
                    <div class="MiddleFoot">
                        <{$vo.des}>
                    </div>
                </div>
                <div class="Right">
                    <span class="Mid"></span><!-- 别换行--><div class="PersonalListOperate">
                        <if condition="$userInfo['nid'] eq $vo['id']">
                            <button onclick="actLink(0)">取消关联</button>
                            <button onclick="location.href='<{:U('Chat/Index/user',array('sender'=>$userInfo['phone'],'receiver'=>$vo['phone'],'name'=>$vo['name']))}>'">对话</button>
                        <else />
                            <button type="button" onclick="location.href='<{:U('Chat/Index/user',array('sender'=>$userInfo['phone'],'receiver'=>$vo['phone'],'name'=>$vo['name'],'seeHistory'=>'1'))}>'">查看聊天记录</button>
                            <button onclick="actLink('<{$vo.id}>')" class="bgcolor-333333">建立关联</button>
                        </if>
                    </div>
                </div> </a>
            </li>
            </foreach>
            </empty>
		</ul>
	</div>

	<!--弹窗 -->
	<div class="Popwindow">
		<div class="PopContent">
			<div class="PopContentTitle" >
				提示
			</div>
			<div class="PopContentText">
				<p>
					非常抱歉，您只能同时关注一位营养师生请先取消关联
				</p>
				<div class="BtnGroup Btn-Popwindow">
					<button class="AddRecord btn-submit">
						确定
					</button>
				</div>
			</div>
		</div>
	</div>
<script type='text/javascript' src='//g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
<script type='text/javascript' src='//g.alicdn.com/msui/sm/0.5.7/js/sm.min.js' charset='utf-8'></script>
<script type='text/javascript' src='__PUBLIC__/js/myjq.js'></script>
<script>
    function actLink(nid){
        var msg = (nid == 0) ? '确定要取消关联此营养师吗' : '您只能关联一位营养师，确定要更改吗';
        if('<{$userInfo.nid}>' == '' ||　'<{$userInfo.nid}>' == '0') msg = '确定要关联此营养师吗';
        if(confirm(msg)){
            $.post('<{:U("actLinkN")}>',{nid:nid},function(){
                location.reload();
            });
        }
    }
</script>
</body>
</html>